#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QLabel>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QStatusBar* statusBar = this-> statusBar();
    this->setStatusBar(statusBar);

    statusBar->showMessage("这是一个临时信息", 3000);

    QLabel* label = new QLabel("这是一个 QLabel");
    statusBar->addPermanentWidget(label);

}

MainWindow::~MainWindow()
{
    delete ui;
}

